package org.seven.jrdp.biz.t.service;

import java.util.List;
import java.util.Map;

import org.seven.jrdp.biz.t.mapper.TKqMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class TKqService {
	@Autowired
	private TKqMapper tKqMapper;

	@Transactional(readOnly = true)
	public List<Map<String, Object>> findKcmx(Map<String, Object> map) {
		List<Map<String, Object>> list = tKqMapper.findKcmx(map);
		for (Map<String, Object> ckmx : list) {
			List<Map<String, Object>> cpmx = tKqMapper.findCpmx((String) ckmx.get("kqmc"));
			ckmx.put("cpmx", cpmx);
		}
		return list;
	}

	@Transactional(readOnly = true)
	public List<Map<String, Object>> findDc() {
		List<Map<String, Object>> list = tKqMapper.findDc();
		for (Map<String, Object> map : list) {
			List<Map<String, Object>> hz = tKqMapper.findDcHz((String) map.get("cpbh"));
			map.put("hz", hz);
			for (Map<String, Object> map1 : hz) {
				List<Map<String, Object>> mx = tKqMapper.findDcMx((String) map.get("cpbh"), (String) map1.get("kqmc"));
				map1.put("mx", mx);
			}
		}
		return list;
	}
}